import request from '@/until/request'
import Vue from 'vue';


// 新增公海
export const seasAdd = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}seas/add`,
    method: 'post',
    data: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 删除公海
export const seasDelete = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}seas/delete`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 公海列表 
export const seasList = () => {
  return request({
    url: `${Vue.prototype.$configURL}seas/list`,
    method: 'get',
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改公海
export const seasUpdate = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}seas/update`,
    data: params,
    method: 'post',
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 公海列表客户
export const customersSeasCus = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}customers/seasCus`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 捞取客户
export const customersSalvage = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}customers/salvage`,
    method: 'post',
    data: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 分配客户
export const customersShareCus = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}customers/shareCus`,
    method: 'post',
    data: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 新增客户
export const customersAdd = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}customers/add`,
    method: 'post',
    data: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 跟进记录
export const customersFollowUpRecord = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}customers/followUpRecord`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改客户和跟进记录
export const customersUpdateQualificationsByUser = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}customers/updateQualificationsByUser`,
    method: 'post',
    data: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 下载客户
export const customersDownloadCus = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}customers/downloadCus`,
    method: 'post',
    data: params,
    responseType: 'blob', // 关键配置
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 批量转移客户
export const customersChangeSeas = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}customers/changeSeas`,
    data: params,
    method: 'post',
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
